//package com.binary.coder.gift.core.config.mq;
//
//import lombok.extern.slf4j.Slf4j;
//import org.apache.rocketmq.client.exception.MQClientException;
//import org.apache.rocketmq.client.producer.DefaultMQProducer;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
///**
// * @author qinqin.luo.
// * @title
// * @time 2022/7/4. RocketMQ生产者配置
// */
//@Configuration
//@Slf4j
//public class RocketMqConfig {
//
//    @Value("${spring.rocketmq.producer.nameServer:}")
//    public String nameServerProducer;
//
//    @Value("${spring.application.name:}")
//    public String groupProducer;
//
//    @Bean
//    public DefaultMQProducer rocketMqProducer(){
//        DefaultMQProducer producer = null;
//        try {
//            producer = new DefaultMQProducer(groupProducer);
//            producer.setNamesrvAddr(nameServerProducer);
//            producer.setVipChannelEnabled(false);
//            producer.setSendMsgTimeout(6000);
//            producer.setInstanceName("sys-producer");
//            producer.setRetryTimesWhenSendAsyncFailed(3);
//            producer.start();
//        } catch (MQClientException e) {
//            log.error("rocketMqProducer start error ",e);
//        }
//        return producer;
//    }
//}
